<template>
  <div class="programDiscipline">
    <!-- 默认应用列表 -->
    <section v-if="!datas.imageList || !datas.imageList[0]" class="defaultNavigation">
      <div v-for="index in 3" :key="index" class="defaultNavigationList">
        <div class="navbg">
          <img draggable="false" src="../../../../assets/images/biancheng.png" alt="" />
          <!-- 标题 -->
          <div class="subtitle">
            <p>这里显示标题</p>
            <span>这里显示描述，最多显示两行</span>
          </div>
          <!-- 阅读量 -->
          <div class="textnum" v-show="datas.readNumberShow">
            <div class="dianz">
              <span>{{ datas.count }}人已学</span>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 图文样式 -->
    <section v-if="datas.imageList || datas.imageList[0]" class="defaultNavigation">
      <div
        v-for="(item, index) in datas.imageList"
        :key="index"
        class="defaultNavigationList"
      >
        <div class="navbg">
          <div v-if="item.bakcgroundImgTop || item.bakcgroundImgBottom">
            <img
              draggable="false"
              :src="item.bakcgroundImgTop"
              alt=""
            />
            <img
              draggable="false"
              :src="item.bakcgroundImgBottom"
              alt=""
            />
          </div>
          <img
            draggable="false"
            v-else
            src="../../../../assets/images/biancheng.png"
            alt=""
          />
          <!-- 标题 -->
          <div class="subtitle">
            <p>{{ item.name }}</p>
            <span>{{ item.desc }}</span>
          </div>
          <!-- 阅读量 -->
          <div class="textnum" v-show="datas.readNumberShow">
            <div class="dianz">
              <span>{{ datas.count }}人已学</span>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>
</template>
<script>
export default {
  name: "programDiscipline",
  props: {
    datas: Object,
  },
  created() {
    console.log(this.datas, "--------programDiscipline");
  },
};
</script>
<style lang="scss" scope>
.programDiscipline {
//   overflow: hidden;
//   height: 366px;
  .defaultNavigation {
    padding: 0 15px;
    box-sizing: border-box;
    .defaultNavigationList {
      position: relative;
      width: 100%;
    //   margin-bottom: 31px;
      .navbg {
        height: 154px;
        // margin-bottom: 15px;
        img {
          width: 100%;
          height: 100%;
          display:block;
        }
        .subtitle {
          position: absolute;
          bottom: 58px;
          left: 18px;
          text-align: left;
          p {
            font-size: 16px;
            font-family: PingFang SC-Semibold, PingFang SC;
            font-weight: 600;
            color: #ffffff;
            line-height: 5px;
          }
          span {
            font-size: 8px;
            font-family: PingFang SC-Regular, PingFang SC;
            font-weight: 400;
            color: #ffffff;
          }
        }
        .textnum {
          position: absolute;
          left: 0;
          bottom: 10px;
          width: 100%;
          height: 30px;
          line-height: 30px;
          .dianz {
            font-size: 12px;
            width: 70px;
            height: 25px;
            color: #fff;
            line-height: 25px;
            text-align: left;
            padding-left: 10px;
            background-color: rgba(0, 0, 0, 0.6);
            background: rgba(62, 62, 62, 0.4);
            border-radius: 0px 10px 0px 10px;
          }
        }
      }
    }
  }
}
</style>
